Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: use null coalescing operator #359

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

connorhu
Copy link
Collaborator

@connorhu connorhu commented Mar 23, 2024

less code happier maintainer

The commit that has a rector prefix is the result of running the rector, the rest is manual.

@connorhu
Copy link
Collaborator Author

@thePanz

This kind of code has a simplified version:

        if (!isset(self::$instance)) {
            self::$instance = new sfAutoload();
        }

        return self::$instance;
        return self::$instance ?? self::$instance = new sfAutoload();

WDYT?

@connorhu connorhu force-pushed the fix/null-coalescing-operator branch from 0896b16 to befc2bb Compare March 23, 2024 06:57
@connorhu connorhu changed the title [action] improvement: use null coalescing operator improvement: use null coalescing operator Apr 9, 2024
@connorhu connorhu force-pushed the fix/null-coalescing-operator branch 3 times, most recently from 4d3f444 to 765a53e Compare April 9, 2024 07:03
@connorhu connorhu force-pushed the fix/null-coalescing-operator branch from 765a53e to 800cd89 Compare April 9, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants